# 导入tk模块
import tkinter

# 定义窗口
window = tkinter.Tk()
window.title('玩闹系统')
# 设置窗口大小
window.geometry('600x400')
# 定义一个文本框
t = tkinter.Text(window, height=2)
t.pack()
# 定义一个输入文本框
entry = tkinter.Entry(window)
entry.pack()


def insert_point():
    var = entry.get()
    t.insert('insert', var)


def insert_end():
    var = entry.get()
    t.insert('end', var)


b1 = tkinter.Button(window, text='插入到指定位置', width=15,height=2, command=insert_point)
b1.pack()

b2 = tkinter.Button(window, text='插入到最后', command=insert_end)
b2.pack()

t.pack()
window.mainloop()